// hyb_yl/doctorHome/pages/set_charge/set_charge.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
      tab_list:[
        {
          name:"图文问诊",
          img:'../../img/tuwen.png',
          url:"/hyb_yl/doctorHome/pages/set_chargedata/set_chargedata"
        },{
          name:"视频问诊",
          img:'../../img/tuwen.png',
          url:"/hyb_yl/doctorHome/pages/set_chargedata/set_chargedata"
        },{
          name:"电话问诊",
          img:'../../img/tuwen.png',
          url:"/hyb_yl/doctorHome/pages/set_chargedata/set_chargedata"
        },{
          name:"挂号",
          img:'../../img/tuwen.png',
          url:"/hyb_yl/doctorHome/pages/set_chargedata/set_chargedata"
        },

      ]
  },
  // 问诊服务详情
  goback:function(e){
    wx.navigateTo({
      url: '/hyb_yl/doctorHome/pages/set_chargedata/set_chargedata?ids='+e.currentTarget.dataset.ids+'&title='+e.currentTarget.dataset.title+'&state='+e.currentTarget.dataset.state,
    })
  },
  // 随访详情
  fuwu_detail:function(e)
  {
    wx.navigateTo({
      url: '/hyb_yl/doctorHome/pages/set_techargedata/set_techargedata?id='+e.currentTarget.dataset.id+'&status='+e.currentTarget.dataset.status,
    })
  },
  // 添加随访计划
  add_fuwu:function(){
    wx.navigateTo({
      url: '/hyb_yl/doctorHome/pages/set_techargedata/set_techargedata?status=1&zid='+this.data.zid,
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    var zid = options.zid;
    that.setData({
      zid:zid
    })
    
  },
  // 获取服务列表
  getFuwu:function(){
    var that = this;
    app.util.request({
      url: 'entry/wxapp/zhuanjia.servertime',
      data: {
        zid: that.data.zid,
        type: ''
      },
      success: function (res) {
        that.setData({
          server: res.data
        })
      }
    })
  },
  // 获取随访计划列表
  getSuifang:function(){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/follow.suifang_list",
      data:{
        zid:that.data.zid,
      },
      success:function(res)
      {
        that.setData({
          fuwu_list:res.data
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this;
    that.getFuwu();
    that.getSuifang();
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})